import pytest

from Initial_po import InitialExecute
from login_po import Login
from tools import DriverTools, execute_assert, click_btn

case_data = [
    ("13751113926", "123456", "账号或密码错误"),
    ("13011992233", "123456", "账号还未注册，请您先进行注册")
]


class TestXueChe:
    def setup_class(self):
        self.driver = DriverTools().OpenDriver()
        self.initial = InitialExecute()  # initial：最初的，开始的   execute：执行
        self.login = Login()
        self.initial.execute()

    def teardown_class(self):
        # 退出驱动
        self.quit = DriverTools().QuiteDriver()

    def setup(self):
        self.driver.implicitly_wait(10)

    def teardown(self):
        click_btn()

    @pytest.mark.parametrize("mobile,password,judge", case_data)
    def test01(self, mobile, password, judge):
        self.login.execute(mobile, password)

        assert judge == execute_assert()
